package cn.lqz.bucttrain.enums;

/**
 * 列车类型枚举
 */
public enum TrainTypeEnum {
    COMMON(0,"普通"),
    FAST(1,"特快"),
    ALL(2,"全选");
    private Integer type;
    private String description;
    TrainTypeEnum(Integer type,String description){
        this.type=type;
        this.description = description;
    }
    public static TrainTypeEnum getByType(Integer type){
        for (TrainTypeEnum trainTypeEnum : TrainTypeEnum.values()) {
            if (trainTypeEnum.getType().equals(type)){
                return trainTypeEnum;
            }
        }
        return null;
    }
    public Integer getType(){
        return type;
    }
    public String getDescription(){
        return description;
    }
}
